import { ElMessageBox } from "element-plus";
import http from "/@ts/axios";
import {
    downloadExcel
} from "/@ts/plugins/download";
export const exportExcel = (data:any) => {
  ElMessageBox.confirm(
    '是否确认导出？',
    '提示',
    {
      confirmButtonText: '导出',
      cancelButtonText: '关闭',
      type: 'warning',
    }
  )
    .then(() => {
       http.request({
    url: data.url,
    method: "POST",
    data:data.url,

      responseType: 'blob'    ,
  })
  .then(res=>{
    downloadExcel(res, data.name)
  })
    })
    .catch(() => {
    
    })
}